package com.authstr.entity;

/**
 * 操作设置
 */
public class OperationSetting {

    /**
     * 操作的表名
     */
    private String tableName;

    /**
     * 指定的唯一键
     */
    private String[] uniqueColumn=new String[]{};

    /**
     * 更新时要忽略的字段
     */
    private String[] updateIgnoreColumn=new String[]{};

    /**
     * 是否在语句前添加注释 默认true
     */
    private Boolean enableAddAnnotation=true;

    private String standard_link_url;
    private String standard_username;
    private String standard_password;
    private String change_link_url;
    private String change_username;
    private String change_password;

    private String newSql;

    private String oldSql;




    /**
     * 是否创建插入语句
     */
    private Boolean enableCreateInsert=true;

    /**
     * 在创建插入语句时,id是否使用生成的UUID,默认使用原id.  默认false
     */
    private Boolean enableUserUUIDOnInsert=false;

    /**
     * 在创建插入语句时,是否先创建删除语句(以Id为限制条件) 默认false
     */
    private Boolean enableDelectByIdOnInsert=false;


    /**
     * 在创建插入语句时,是否先创建删除语句(以唯一键为限制条件)    默认false
     */
    private Boolean enableDelectByUniqueOnInsert=false;





    /**
     * 是否创建更新语句
     */
    private Boolean enableCreateUpdate=true;

    /**
     * 在创建更新时,对于值一样的数据,是否也写在更新语句中  默认false
     */
    private Boolean enableUpdateSameOnUpdate=false;


    /**
     * 在创建更新时,是否先创建删除语句(以Id为限制条件) 默认false
     */
    private Boolean enableDelectByIdOnUpdate=false;

    /**
     * 在创建更新时,是否先创建删除语句(以唯一键为限制条件)    默认false
     */
    private Boolean enableDelectByUniqueOnUpdate=false;

    /**
     * 在创建更新时,是否以插入语句来进行修改  默认false
     */
    private Boolean enableChangeInsertOnUpdate=true;

    /**
     * 在创建更新时,插入语句是否使用UUID  默认false
     */
    private Boolean enableUserUUIDOnUpdate=true;


    public String getStandard_link_url() {
        return standard_link_url;
    }

    public void setStandard_link_url(String standard_link_url) {
        this.standard_link_url = standard_link_url;
    }

    public String getStandard_username() {
        return standard_username;
    }

    public void setStandard_username(String standard_username) {
        this.standard_username = standard_username;
    }

    public String getStandard_password() {
        return standard_password;
    }

    public void setStandard_password(String standard_password) {
        this.standard_password = standard_password;
    }

    public String getChange_link_url() {
        return change_link_url;
    }

    public void setChange_link_url(String change_link_url) {
        this.change_link_url = change_link_url;
    }

    public String getChange_username() {
        return change_username;
    }

    public void setChange_username(String change_username) {
        this.change_username = change_username;
    }

    public String getChange_password() {
        return change_password;
    }

    public void setChange_password(String change_password) {
        this.change_password = change_password;
    }

    /**
     * 是否创建删除语句
     */
    private Boolean enableCreateDelete=true;

    /**
     * 删除语句是否以唯一键作为限制条件进行创建(默认使用id) 默认false
     */
    private Boolean enableUserUniqueDelete=false;

    public DatabaseParameter createNewConn(){
        DatabaseParameter newConn=new DatabaseParameter();
        newConn.setLink_url(getStandard_link_url());
        newConn.setUsername(getStandard_username());
        newConn.setPassword(getStandard_password());
        return  newConn;
    }

    public DatabaseParameter createOldConn(){
        DatabaseParameter oldConn=new DatabaseParameter();
        oldConn.setLink_url(getChange_link_url());
        oldConn.setUsername(getChange_username());
        oldConn.setPassword(getChange_password());
        return  oldConn;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String[] getUniqueColumn() {
        return uniqueColumn;
    }

    public void setUniqueColumn(String[] uniqueColumn) {
        this.uniqueColumn = uniqueColumn;
    }

    public String[] getUpdateIgnoreColumn() {
        return updateIgnoreColumn;
    }

    public void setUpdateIgnoreColumn(String[] updateIgnoreColumn) {
        this.updateIgnoreColumn = updateIgnoreColumn;
    }

    public Boolean getEnableAddAnnotation() {
        return enableAddAnnotation;
    }

    public void setEnableAddAnnotation(Boolean enableAddAnnotation) {
        this.enableAddAnnotation = enableAddAnnotation;
    }

    public String getNewSql() {
        return newSql;
    }

    public void setNewSql(String newSql) {
        this.newSql = newSql;
    }

    public String getOldSql() {
        return oldSql;
    }

    public void setOldSql(String oldSql) {
        this.oldSql = oldSql;
    }

    public Boolean getEnableCreateInsert() {
        return enableCreateInsert;
    }

    public void setEnableCreateInsert(Boolean enableCreateInsert) {
        this.enableCreateInsert = enableCreateInsert;
    }

    public Boolean getEnableUserUUIDOnInsert() {
        return enableUserUUIDOnInsert;
    }

    public void setEnableUserUUIDOnInsert(Boolean enableUserUUIDOnInsert) {
        this.enableUserUUIDOnInsert = enableUserUUIDOnInsert;
    }

    public Boolean getEnableDelectByIdOnInsert() {
        return enableDelectByIdOnInsert;
    }

    public void setEnableDelectByIdOnInsert(Boolean enableDelectByIdOnInsert) {
        this.enableDelectByIdOnInsert = enableDelectByIdOnInsert;
    }

    public Boolean getEnableDelectByUniqueOnInsert() {
        return enableDelectByUniqueOnInsert;
    }

    public void setEnableDelectByUniqueOnInsert(Boolean enableDelectByUniqueOnInsert) {
        this.enableDelectByUniqueOnInsert = enableDelectByUniqueOnInsert;
    }

    public Boolean getEnableCreateUpdate() {
        return enableCreateUpdate;
    }

    public void setEnableCreateUpdate(Boolean enableCreateUpdate) {
        this.enableCreateUpdate = enableCreateUpdate;
    }

    public Boolean getEnableUpdateSameOnUpdate() {
        return enableUpdateSameOnUpdate;
    }

    public void setEnableUpdateSameOnUpdate(Boolean enableUpdateSameOnUpdate) {
        this.enableUpdateSameOnUpdate = enableUpdateSameOnUpdate;
    }

    public Boolean getEnableDelectByIdOnUpdate() {
        return enableDelectByIdOnUpdate;
    }

    public void setEnableDelectByIdOnUpdate(Boolean enableDelectByIdOnUpdate) {
        this.enableDelectByIdOnUpdate = enableDelectByIdOnUpdate;
    }

    public Boolean getEnableDelectByUniqueOnUpdate() {
        return enableDelectByUniqueOnUpdate;
    }

    public void setEnableDelectByUniqueOnUpdate(Boolean enableDelectByUniqueOnUpdate) {
        this.enableDelectByUniqueOnUpdate = enableDelectByUniqueOnUpdate;
    }

    public Boolean getEnableChangeInsertOnUpdate() {
        return enableChangeInsertOnUpdate;
    }

    public void setEnableChangeInsertOnUpdate(Boolean enableChangeInsertOnUpdate) {
        this.enableChangeInsertOnUpdate = enableChangeInsertOnUpdate;
    }

    public Boolean getEnableUserUUIDOnUpdate() {
        return enableUserUUIDOnUpdate;
    }

    public void setEnableUserUUIDOnUpdate(Boolean enableUserUUIDOnUpdate) {
        this.enableUserUUIDOnUpdate = enableUserUUIDOnUpdate;
    }

    public Boolean getEnableCreateDelete() {
        return enableCreateDelete;
    }

    public void setEnableCreateDelete(Boolean enableCreateDelete) {
        this.enableCreateDelete = enableCreateDelete;
    }

    public Boolean getEnableUserUniqueDelete() {
        return enableUserUniqueDelete;
    }

    public void setEnableUserUniqueDelete(Boolean enableUserUniqueDelete) {
        this.enableUserUniqueDelete = enableUserUniqueDelete;
    }
}
